﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AWSInterface
{
    public class AWSResult
    {
        public string Title { get; set; }

        public string Description { get; set; }

        public string ImageLargeURL { get; set; }

        public string ASIN { get; set; }

        public string Cast { get; set; }

        public string Director { get; set; }

        public string TheatricalRelease { get; set; }

        public string DetailPageURL { get; set; }

        public System.Windows.Media.Imaging.BitmapImage Thumbnail { get; set; }

        public AWSResult()
        {
            blankValues();
        }

        public AWSResult(string sTitle, string sDescription, string sImageLargeUrl, string sASIN, string sCast, string sDirector, string sTheatricalRelease, string sDetailPageURL, System.Windows.Media.Imaging.BitmapImage imgThumbnail)
        {
            blankValues();

            Title = sTitle;
            Description = sDescription;
            ImageLargeURL = sImageLargeUrl;
            ASIN = sASIN;
            Cast = sCast;
            Director = sDirector;
            TheatricalRelease = sTheatricalRelease;
            DetailPageURL = sDetailPageURL;
            Thumbnail = imgThumbnail;
        }

        public AWSResult(string sTitle, string sDescription, string sImageLargeUrl, string sASIN, string[] sCast, string[] sDirectors, string sTheatricalRelease, string sDetailPageURL, System.Windows.Media.Imaging.BitmapImage imgThumbnail)
        {
            blankValues();

            Title = sTitle;
            Description = sDescription;
            ImageLargeURL = sImageLargeUrl;
            ASIN = sASIN;

            foreach (string sActor in sCast)
            {
                Cast += sActor + ", ";
            }
            if (Cast.Contains(','))
            {
                Cast = Cast.Remove(Cast.Length - 2);
            }

            foreach (string sDirector in sDirectors)
            {
                Director += sDirector + ", ";
            }
            if (Director.Contains(','))
            {
                Director = Director.Remove(Director.Length - 2);
            }

            TheatricalRelease = sTheatricalRelease;
            DetailPageURL = sDetailPageURL;
            
            Thumbnail = imgThumbnail;
        }

        public void blankValues()
        {
            Title = String.Empty;
            Description = String.Empty;
            ImageLargeURL = String.Empty;
            ASIN = String.Empty;
            Cast = String.Empty;
            Director = String.Empty;
            TheatricalRelease = String.Empty;
            DetailPageURL = String.Empty;
            Thumbnail = null;
        }
    }
}
